package com.bamboo.eduservice.controller.front;

import com.bamboo.commonutils.ResponseEntity;
import com.bamboo.eduservice.service.EduTeacherService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * 前台讲师控制器
 *
 * @author jack.wu
 * @version 1.0
 * @date 2020-07-18
 */
@Api(description = "前台讲师管理")
@CrossOrigin
@RestController
@RequestMapping("/eduservice/front")
public class FrontTeacherController {

    @Resource
    private EduTeacherService teacherService;

    @ApiOperation(value = "前台分页查询讲师")
    @GetMapping("teacherList/{page}/{limit}")
    public ResponseEntity getFrontTeacherList(@PathVariable long page, @PathVariable long limit) {
        Map<String, Object> result = teacherService.getFrontTeacherList(page, limit);
        return ResponseEntity.ok().data(result);
    }

    @ApiOperation(value = "前台查询讲师详情")
    @GetMapping("teacher/{id}")
    public ResponseEntity getTeacherInfo(@PathVariable String id) {
        Map<String, Object> result = teacherService.getTeacherInfo(id);
        return ResponseEntity.ok().data(result);
    }


}
